import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children:[
      {
        path: '/hoem/searchPopup',
        name: 'SearchPopup',
    component: () => import(/* webpackChunkName: "searchPopup" */ '../views/SearchPopup.vue')
      },
      
    ]
  },
  
  {
     path: '/hoem',
     name: 'Sy',
     component: () => import(/* webpackChunkName: "sy" */ '../views/Home.vue')
  },
  {
     path: '/hoem/zt',
     name: 'Zt',
     component: () => import(/* webpackChunkName: "zt" */ '../views/Zt.vue')
  },
  {
     path: '/hoem/fl',
     name: 'Fl',
     component: () => import(/* webpackChunkName: "fl" */ '../views/Fl.vue')
  },
  {
     path: '/hoem/gwc',
     name: 'Gwc',
     component: () => import(/* webpackChunkName: "gwc" */ '../views/Gwc.vue')
  },
  {
     path: '/hoem/user',
     name: 'User',
     component: () => import(/* webpackChunkName: "user" */ '../views/User.vue')
  }
  
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
